<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var myMath = {
      PI: 3.1415926,
      max: function () {
        var maxValue = arguments[0]

        for (var i = 1; i < arguments.length; i++) {
          if (maxValue < arguments[i]) {
            maxValue = arguments[i]
          }
        }

        return maxValue
      },
      min: function () {
        var minValue = arguments[0]

        for (var i = 1; i < arguments.length; i++) {
          if (minValue > arguments[i]) {
            minValue = arguments[i]
          }
        }

        return minValue
      }
    }

    console.log(myMath.min(1, 4, 8, 10))
  </script>
</body>

</html>